home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- from checkbox.lib.template_i18n import TemplateI18n
- from checkbox.properties import List, Path, String
- from checkbox.plugin import Plugin
- from checkbox.test import Test
-
- class SuitesInfo(Plugin):
- directories = List(type = Path(), default_factory = (lambda : '%(checkbox_share)s/suites'))
- scripts_path = Path(default = '%(checkbox_share)s/scripts')
- data_path = Path(default = '%(checkbox_share)s/data')
- blacklist = List(type = String(), default_factory = (lambda : ''))
- whitelist = List(type = String(), default_factory = (lambda : ''))
-
- def register(self, manager):
- super(SuitesInfo, self).register(manager)
- self._manager.reactor.call_on('gather', self.gather)
-
-
- def gather(self):
- template = TemplateI18n('suite', [
- 'name'])
- elements = template.load_directories(self.directories, self.blacklist, self.whitelist)
- for element in elements:
- long_ext = '_extended'
- for long_key in element.keys():
- if long_key.endswith(long_ext):
- short_key = long_key.replace(long_ext, '')
- element[short_key] = element.pop(long_key)
- continue
-
- test = Test(self._manager.registry, **element)
- for command in (test.command, test.description):
- command.add_path(self.scripts_path)
- command.add_variable('data_path', self.data_path)
-
- self._manager.reactor.fire('test-%s' % test.plugin, test)
-
-
-
- factory = SuitesInfo
-